package webservice;

import java.util.List;

import javax.ejb.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;

import model.ACLMessage;
import model.AgentInfo;
import model.Host;
import model.User;
import util.HashMapWrapper;
import agents.Agent;

@WebService(name = "NodeCommunicationWSProxy", targetNamespace = "http://1337.webservice")
@SOAPBinding(style = Style.RPC, parameterStyle=ParameterStyle.WRAPPED, use=Use.LITERAL)
@Remote

public interface NodeCommunicationWS {
	@WebMethod(operationName="register")
	public List<Host> register(Host host);
	
	@WebMethod(operationName="notifyRegister")
	public void notifyRegister(Host host);
	
	@WebMethod(operationName="unregister")
	public void unregister(Host host);
	
	@WebMethod(operationName="notifyUnregister")
	public void notifyUnregister(Host host);
	
	@WebMethod(operationName="getAllHosts")
	public List<Host> getAllHosts();
	
	@WebMethod(operationName="publish")
	public void publish(ACLMessage message);

	@WebMethod(operationName="getAllAgents")
	public List<Agent> getAllAgents();

	@WebMethod(operationName="updateAgentList")
	public void updateAgentList(HashMapWrapper wrappedAgents);
	
	@WebMethod(operationName="notifyUpdateAgentList")
	public void notifyUpdateAgentList(HashMapWrapper wrappedAgents);

	@WebMethod(operationName="getAllUsers")
	public List<User> getAllUsers();

	@WebMethod(operationName="updateUserList")
	public void updateUserList(List<User> loggedUsers);

	@WebMethod(operationName="getAgent")
	public Agent getAgent(String key);

	@WebMethod(operationName="getAnyMasterAgentInfo")
	public AgentInfo getAnyMasterAgentInfo();

	@WebMethod(operationName="getAgentInfo")
	public AgentInfo getAgentInfo(String key);
}
